<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="common/common">

<div class="centerView" data-type="index" th:fragment="content">
    <!-- 非常轻量级的代码高亮插件 用来增强pre的功能 由于本次只用在log显示上，所以单独放在这 而不放公共区域 -->
    <link rel="stylesheet" th:href="@{/prism/prism.css(path=${contextPath})}"/>
    <script th:src="@{/prism/prism.js(path=${contextPath})}"></script>
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper" id="log">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">系统日志</div>
                        </div>
                        <div class="am-g error-log">
                            <div class="am-u-sm-12 am-u-sm-centered" style="margin: 10px">
                                <select data-am-selected="{searchBox: 1,btnWidth: '300px'}" style="display: none;" id="fileName">
                                    <option v-for="fileName in fileNames" v-bind:value="fileName">
                                        {{ fileName }}
                                    </option>
                                </select>
                                <!--<pre class="am-pre-scrollable" ><code id="logPre" class="line-numbers,language-java">加载中，请稍后。</code></pre>-->
                                <pre class="am-pre-scrollable line-numbers"><code class="language-Java" id="logPre"></code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script th:src="@{/js/logs.js}"></script>
    <script>
        $(document).ready(function () {
            $('#logs').attr('class', 'active');
            //自适应pre部分
            reSizePre();
            //加载log
            $('#fileName').on('change', function() {
                readFiles();
            });
            readFiles();
        });
    </script>
</div>
</html>